using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DynamicModelDemo.EntityFramework
{
    public class DynamicKeyFactory : IModelCacheKeyFactory
    {
        public object Create(DbContext context)
        {
            if (context is MyDbContext dx)
            {
                return (context.GetType(), dx.CreationTime);
            }
            return context.GetType();
        }
    }
}
